home *** CD-ROM | disk | FTP | other *** search
-
- #include "../CGVPMacro.csi"
-
-
- MainInput { VIEWPROJ_MATRIX, CAMERA_POS, uniform float4 GeomConstants, uniform float4 StartColor, uniform float4 EndColor, uniform float3 LightForward }
- DeclarationsScript
- {
- IN_T0_N
- OUT_T0_C0
- }
- PositionScript = PosBeam
- CoreScript
- {
- // color = Lerp(StartColor, EndColor, fLerp)
- float4 color = lerp(StartColor, EndColor, fLerp);
-
- float3 camVec = normalize(CameraPos.xyz - vPos.xyz);
-
- float d = dot(camVec.xyz, vNormal.xyz);
- d = d * d;
- d *= min(fLerp*10, vPos.w);
-
- color.w = color.w * d;
-
- OUT.Color = color;
- OUT.Tex0.xy = IN.TexCoord0.xy;
- }
-